<div class="admin">
<div class="tab panel dux-box admin-panel">
    <div class="panel-head"><strong>文章</strong></div>
    <div class="padding border-bottom">
        <a href="{:U('Article/add')}" class="button button-small border-green">添加新文章</a>
    </div>
    <div class="fixed-empty"></div>
    <form method="get" action={:U('Article/index')} name="formSearch" id="formSearch" >
            <div class="table-tools clearfix ">
                <div class="float-left">
                    <div class="form-inline">
                        <div class="form-group">
                            <div class="field"><label>文章标题：</label><input class="input input_big" name="title" type="text" id="search_brand_name" value={$title} ></div>
                            <div class="field"><label>订单状态：</label>
                            <select name="cat_id" id="gc_parent_id" class="querySelect">
                                <option value="0">所有分类</option>
                                <volist name="cat" id="v">
                                    <option value ="{$v['cat_id']}" <?php if($v['cat_id'] == $id){echo "selected = 'selected'";}?>>
                                        {$v['cat_name']}
                                    </option>
                                </volist>
                            </select>
                            </div>
                        </div>
                        <div class="form-button">
                            <button class="button bg-blue" type="submit">查询</button>
                        </div>
                    </div>
                </div>
            </div>
    </form>
    <form method='post' action="" id="myForm" name="myForm">
        <table class="table tb-type2">
            <thead>
            <tr class="thead">
                <th>编号</th>
                <th>分类</th>
                <th>标题</th>
                <th width="15%">添加日期</th>
                <th width="6%">推荐</th>
                <th width="15%">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="vo">
                <tr class="hover edit">
                    <td>{$vo['article_id']}</td>
                    <td>{$vo['cat_id']}</td>
                    <td>{$vo['title']}</td>
                    <td>
                        <?php echo date('Y-m-d H:i:s',$vo['add_time']);?>
                    </td>
                    <td>
                    <if condition="$vo['is_put'] eq 1">
                        <a class="button bg-green button-little" href="javascript:(0)" data="1" title="已置顶/点击取消" onclick="tuijian({$vo['article_id']},'已置顶，确认取消置顶吗？')"><i class="icon-eye"></i>置顶</a>
                        <else />
                        <a class="button bg-gray button-little" href="javascript:(0)" data="1" title="未置顶/点击置顶" onclick="tuijian({$vo['article_id']},'未置顶，确认置顶吗？')"><i class="icon-eye-slash"></i>置顶</a>
                    </if>
                    </td>
                    <td class="align-center">
                        <a class="button bg-green button-little" target="_blank" href="{:HOME_URL}/Article/{$vo['article_id']}" title="预览"><i class="icon-eye"></i>预览</a>
                        <a class="button bg-blue button-little" href="{:U('/Article/edit',array('id'=>$vo['article_id']))}" title="编辑"><i class="icon-edit"></i>编辑</a>
                        <a class="button bg-red button-little js-del" data="{$vo['article_id']}"  href="javascript:;" title="删除"><i class="icon-minus-circle"></i>删除</a>
                    </td>
                </tr>
            </volist>

            </tbody>
            <tfoot class="panel-foot">
            <tr colspan="15" class="tfoot">
                <td colspan="15"><div class="pages clearfix">{$page}</div></td>
            </tr>
            </tfoot>
        </table>
    </form>
    <div class="clear"></div>
</div>
</div>
<script type="text/javascript">
$('#myForm').layer({
    actionUrl: "batchAction",
    deleteUrl: "{:U('/Article/delete')}",
});

function tuijian(dete,title){
    layer.confirm(title,{btn: ['是的', '算了'] },function(){
            dete = {goods_id:dete};
            var p = Aajax("{:ADMIN_URL}{:U('ArticleCat/cat_hide')}", dete);
            if (p.n){
                layer.msg('操作成功');
                setTimeout("history.go(0)", 1000);
            } else{
                layer.msg('出错请稍后再试');
            }
        }
    );
}
</script>
</body>

